//
//  PetHouseAppService.swift
//
//  Created by Jack Lee on 2019/8/20.
//

import UIKit

let kScreenWidth = UIScreen.main.bounds.size.width
let kScreenHeight = UIScreen.main.bounds.size.height
let kScreenSize = UIScreen.main.bounds.size
let globalDateFormat = DateFormatter()

let defaultAvatarImage:UIImage? = UIImage(named: "avatar_default")
let defaultImage:UIImage? = UIImage(named: "image_default")

let kAppVersion = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as! String

let iPhone35:Bool = __CGSizeEqualToSize(UIScreen.main.bounds.size, CGSize(width: 320, height: 480 ))
let iPhone40:Bool = __CGSizeEqualToSize(UIScreen.main.bounds.size, CGSize(width: 320, height: 568 ))
let iPhone47:Bool = __CGSizeEqualToSize(UIScreen.main.bounds.size, CGSize(width: 375, height: 667 ))
let iPhone55:Bool = __CGSizeEqualToSize(UIScreen.main.bounds.size, CGSize(width: 414, height: 736 ))

let kPageSize:Int = 20

var kIsIphoneX: Bool {
    var iPhoneX = false
    if #available(iOS 11.0, *) {
        iPhoneX = UIApplication.shared.statusBarFrame.size.height == 44 ? true : false
    }
    return iPhoneX
}

func FIT_WIDTH(_ width:CGFloat) -> CGFloat {
    return  width * kScreenWidth / 375.0
}

let kStatusBarHeight = UIApplication.shared.statusBarFrame.size.height
let kNavStatusBarHeight = kIsIphoneX ? CGFloat(88) : CGFloat(64)
let kSafeBottomHeight = kIsIphoneX ? CGFloat(34) : CGFloat(0)
